<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>选择退款方式</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <link rel="stylesheet" href="/node_modules/LobsterUIFrame/weui/css/weui.css" />
    <link rel="stylesheet" href="/node_modules/LobsterUIFrame/weui/css/weuix.css" />
    <script src="/node_modules/LobsterUIFrame/weui/js/zepto.min.js"></script>
    <script src="/node_modules/LobsterUIFrame/weui/js/zepto.weui.js"></script>
    <script src="/node_modules/LobsterUIFrame/weui/js/swipe.js"></script>
    <script src="/node_modules/LobsterUIFrame/weui/js/macy.js"></script>
    <script src="/node_modules/LobsterUIFrame/weui/js/php.js"></script>
    <script src="/lobstersdk/lobster.js"></script>
    <script src="/jslib/template-web.js"></script>
    <style>

    </style>
</head>

<body ontouchstart>
    <div class="weui-cells__title">商品信息</div>
    <div class="weui-panel__bd" id="goods">

    </div>
    <div class="weui-cells__title">选择服务类型</div>
    <div class="weui-panel__bd">
        <a href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg torefund">
            <div class="weui-media-box__hd">
                <img class="weui-media-box__thumb" src="../images/refund.png" alt="">
            </div>
            <div class="weui-media-box__bd">
                <h4 class="weui-media-box__title">我要退款（无需退货）</h4>
                <p class="weui-media-box__desc">没收到货，或与商家协商同意不用退货只退款</p>
            </div>
        </a>
        <a href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg toreturnrefund">
            <div class="weui-media-box__hd">
                <img class="weui-media-box__thumb" src="../images/returnrefund.png" alt="">
            </div>
            <div class="weui-media-box__bd">
                <h4 class="weui-media-box__title">我要退货退款</h4>
                <p class="weui-media-box__desc">已收到货，需要退还收到的货物</p>
            </div>
        </a>
    </div>
</body>

</html>

<script type="text/template" id="goodstemp">
    {{each list item}}
    <a href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg">
        <div class="weui-media-box__hd">
            <img class="weui-media-box__thumb" src="{{item.SpecImg}}" alt="">
        </div>
        <div class="weui-media-box__bd">
            <h4 class="weui-media-box__title">{{item.GoodsName}}</h4>
            <p class="weui-media-box__desc">规格 {{item.SpecName}}</p>
            <div class="weui-media-box__desc" style="display: flex;"> ￥{{item.GoodsPrice}} <div style="flex:1;text-align:right">
                </div>x{{item.GoodsNum}}</div>
        </div>
    </a>
    {{/each}}
</script>

<script>

    lobsterh5.main({
        data: {
            goods: [],
        },
        //初始化页面
        pageload: function () {
            this.initevent();
            this.data.goods = JSON.parse(lobsterh5.GetUrlParam("goods", decodeURIComponent(location.href)));
            var html = template("goodstemp", { list: this.data.goods });
            $("#goods").html(html);
        },
        //初始化事件
        initevent: function () {
            var self = this;
            $(".torefund").click(function () {
                location.href = "refund.html?type=1&goods=" + JSON.stringify(self.data.goods);
            })
            $(".toreturnrefund").click(function () {
                location.href = "refund.html?type=2&goods=" + JSON.stringify(self.data.goods);
            })
        },
    })
</script>